﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="details.aspx.vb" Inherits="Veterans.details" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp;<asp:Panel ID="Panel2" runat="server" Visible="false" style=" text-align: center;">
       <asp:label ID="Label1" runat="server"> Login to add comment </asp:label>
    </asp:Panel>
        &nbsp;</p>
    <p>
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" 
            Height="50px" Width="100%" >

            <AlternatingRowStyle BackColor="White" />
            <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
            <EditRowStyle BackColor="#2461BF" />
            <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
            <Fields>
                <asp:ImageField DataImageUrlField="T_Picture" DataImageUrlFormatString="/Images/{0}" HeaderText="Picture">
                    <ControlStyle CssClass="DetailImage" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:ImageField>
                <asp:BoundField DataField="T_Title" HeaderText="Subject" />
                <asp:BoundField DataField="T_Text" HeaderText="Text" />
                <asp:BoundField DataField="T_Writer" HeaderText="Writer" />
                <asp:BoundField DataField="T_time" HeaderText="Added Date" />
                <asp:BoundField DataField="T_type" HeaderText="Category" />
            </Fields>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
        </asp:DetailsView>
    </p>
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT [T_ID], [T_Title], [T_Picture], [T_Text], [T_Writer], [T_time], [T_type] FROM [TBL_Topics] WHERE ([T_ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="T_ID" QueryStringField="D" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    <br />
    <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2">
        <HeaderTemplate>
                <p> Comments : </p>
        </HeaderTemplate>
        <ItemTemplate>
                <hr />
                <p style="width: 100%; text-align: left;"> <%# Container.DataItem("C_title")%></p>
                <p style="width: 100%; text-align: center;"><%# Container.DataItem("C_Text")%></p>
                <p style="width: 100%; text-align: right;"> Added by <%# Container.DataItem("C_Writer")%> at <%# Container.DataItem("C_Date")%> </p>
        </ItemTemplate>
        <FooterTemplate>
                <hr />
                <p> End of Comments </p>
        </FooterTemplate>
    </asp:Repeater>
    <br />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            
        SelectCommand="SELECT [C_ID], [C_title], [C_Text], [C_Writer], [C_Date], [T_fkID] FROM [TBL_Comments] WHERE ([T_fkID] = ?) Order by [C_Date]">
            <SelectParameters>
                <asp:QueryStringParameter Name="T_fkID" QueryStringField="D" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>


    <asp:Panel ID="Panel1" runat="server">
<!--
    link to the control 
    http://www.asp.net/web-forms/tutorials/ajax-control-toolkit/getting-started/get-started-with-the-ajax-control-toolkit-cs 
    link to the image
    http://www.ratecity.com.au/images/star-ratings.png

-->

<!-- 
   link to like image
   http://www.jillianney.com/wp-content/uploads/2012/01/like.png
-->
        <asp:Image ID="img_Like" alt="" runat="server" src="Images/like.png" visible="false"  />
        <asp:Button ID="Btn_like" runat="server" Text="Like" />
        <br />

        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
        <strong> 
        <br />
        Rate This Topic: </strong>
	    <asp:Rating ID="Rating1" runat="server" 
		    WaitingStarCssClass="doneRating" 
		    StarCssClass="Star"
		    FilledStarCssClass="Star" 
		    EmptyStarCssClass="EmptyStar">
        </asp:Rating>
        <br />
        <br />
        <asp:Button ID="btn_Rate" runat="server" Text="Rate!" />
        <br />
        <asp:Label ID="lbl_Rating" runat="server"></asp:Label>
        <p>
            <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
                DataSourceID="TagsDataSource" DataTextField="Tag_Name" DataValueField="Tag_ID" 
                RepeatDirection="Horizontal">
            </asp:CheckBoxList>
            Add new Tags Here, seperate tags by commas:<br />
            <asp:TextBox ID="TextBox1" runat="server" Width="378px"></asp:TextBox>
            <asp:SqlDataSource ID="TagsDataSource" runat="server" 
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                SelectCommand="SELECT [Tag_ID], [Tag_Name] FROM [TBL_Tags]">
            </asp:SqlDataSource>
            <br />
            <asp:Button ID="Tag" runat="server" Text="Tag This Topic" />
            <br />
            <asp:Label ID="lbl_Tag" runat="server"></asp:Label>
            <br />
            <br />
            <br />
        </p>
        <table style="width: 100%; text-align: center;">
            <tr>
                <td colspan="2" style="text-align: center; font-size: large; ">
                    Add Comment
                </td>
            </tr>
            <tr>
                <td style="width: 20%; text-align: right;">
                    Title:
                </td>
                <td style="text-align: left;">
                    <asp:TextBox ID="TB_Title" runat="server" MaxLength="255" Width="600px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 20%; text-align: right;">
                    Text:
                </td>
                <td style="text-align: left;">
                    <asp:TextBox ID="TB_Text" runat="server" Height="200px" TextMode="MultiLine" 
                        Width="600px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btn_Submit" runat="server" Text="Add Comment" Width="172px" />
                </td>
            </tr>
        </table>
    </asp:Panel> 

</asp:Content>

